package promotion

import (
	// "bp/cache"
	sqlc "bp/db/sqlc"
)

type FilterPromotionPtrsFunc func(*sqlc.Promotion) bool


// FilterPromotionPtrs  []*sqlc.Promotion => []*sqlc.Promotion
func (s *PromotionEntityServiceImp) FilterPromotionPtrs(ptrs []*sqlc.Promotion, filter FilterPromotionPtrsFunc) []*sqlc.Promotion {
	if len(ptrs) == 0 {
		return ptrs
	}
	var valPtrs []*sqlc.Promotion
	for _, ptr := range ptrs {
		if filter(ptr) {
			valPtrs = append(valPtrs, ptr)
		}
	}
	return valPtrs
}